Skip to content

Fix scheduling pre-step to exit cleanly when no programs are due#28

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-scheduling-pre-step-exit
Draft

Fix scheduling pre-step to exit cleanly when no programs are due#28
Copilot wants to merge 2 commits intomainfrom
copilot/fix-scheduling-pre-step-exit

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

The scheduling pre-step exits with process.exit(1) when no programs are due, causing every idle scheduled run to show as a failed workflow (red X) in the Actions UI. On a 6h schedule, most runs have nothing to do — this is normal, not an error.

Changes

  • process.exit(1)process.exit(0) for the "no programs due" path, matching the existing no_programs: true early-exit pattern
  • Added not_due flag to the /tmp/gh-aw/autoloop.json sentinel so the agent step can explicitly distinguish "nothing to do" from "program selected"
  • Documented not_due in the agent instructions section alongside the existing JSON contract fields
const notDue = !selected && unconfigured.length === 0;
const result = {
    selected: selected,
    // ...
    no_programs: false,
    not_due: notDue,
};

Error exits (process.exit(1)) for forced-program-not-found, forced-program-unconfigured, and unhandled exceptions are unchanged.

Change process.exit(1) to process.exit(0) when no programs are due for
a scheduled run. The non-zero exit was causing the workflow to show as
failed (red X) in the Actions UI even though "no programs due" is an
expected outcome.

Also add a `not_due` flag to the JSON sentinel written to
/tmp/gh-aw/autoloop.json so the agent step can explicitly detect
this case, and document it in the agent instructions.

Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/4d303a41-1658-4db8-bd17-24f7ed43d323

Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix scheduling pre-step to exit successfully when no programs are due Fix scheduling pre-step to exit cleanly when no programs are due Apr 4, 2026
Copilot finished work on behalf of mrjf April 4, 2026 05:06
Copilot AI requested a review from mrjf April 4, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduling pre-step: sys.exit(1) fails workflow noisily when no programs are due

2 participants